export const baseInfo = ctx => {
  console.log(ctx.isFormSale, 'ctx.isFormSale')
  return [
    {
      label: 'name',
      name: '产品名称'
    },
    {
      label: 'childCategoryName',
      name: '产品类目'
    },
    {
      label: 'typeName',
      name: '产品类型'
    },
    {
      name: '关联产品',
      hide: +ctx.form.isMulti === 0,
      render: (h, row) => {
        let arr = []
        ctx.form.productListName &&
          ctx.form.productListName.map(item => {
            arr.push(
              <zm-button
                type="text"
                onClick={() => {
                  ctx.checkDetail(item)
                }}
              >
                {item.name + '  '}
              </zm-button>
            )
          })
        return <div>{arr}</div>
      }
    },
    {
      label: 'brand',
      name: '品牌',
      hide: +ctx.form.isMulti === 1
    },
    {
      name: '图片',
      render: (h, row) => {
        const img = <el-image style="width: 100%; height: 100%" fit='fit' src={ctx.form.image} />
        return <div style="width:45px;height:45px;verticalAlign: middle;">{img}</div>
      },
      // style="width:100px;height:50px"
      hide: +ctx.form.isMulti === 1
    },
    {
      label: 'origin',
      name: '产地',
      hide: +ctx.form.isMulti === 1
    },
    {
      label: 'shelfLife',
      name: '保质期(月)',
      hide: +ctx.form.isMulti === 1
    },
    {
      label: 'specification',
      name: '规格',
      hide: +ctx.form.isMulti === 1
    },
    {
      label: 'unit',
      name: '单位',
      hide: +ctx.form.isMulti === 1
    },
    {
      label: 'deliveryMoney',
      name: '运费(元)'
    },
    {
      hide: ctx.isFormSale,
      label: 'costPrice',
      name: '成本价(元)'
    },
    {
      label: 'minSalePrice',
      name: '最低销售单价(元)'
    },
    {
      label: 'apartmentListName',
      name: '产品可售部门'
    },
    {
      label: 'usageRules',
      name: '使用规则'
    },
    {
      label: 'remark',
      name: '产品备注'
    }
  ]
}
